package helpers;

import java.util.HashMap;

import javax.cache.Cache;

public class CacheHelper {
	private static Cache memCache;
	private static HashMap<String, Object> mapCache ;
	static
	{
		
		memCache = GeneralHelper.getCache();
		mapCache = new HashMap<String, Object>();
		
		
	}
	public static void put(String key,Object value)
	{
		memCache.put(key, value);
		mapCache.put(key, value);
		
	}
	public static Object get(String key)
	{
		Object obj = mapCache.get(key);
		if(obj!=null)
		{
			return obj;
			
		}
		else
		{
			obj= memCache.get(key);
			
		}
		return obj;
	}
	
}
